// pages/index/comps/shopGoods/shopGoods.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        shopGoodsClassify: Array,
        shopGoodsClassifyIndex: String,
        shopGoodsList: Array
    },

    /**
     * 组件的初始数据
     */
    data: {
        
    },

    /**
     * 组件的方法列表
     */
    methods: {
        navClick: function(e) {
            this.triggerEvent('navClick', e.currentTarget.dataset.index)
        },

        goGoodsDetail: function(e) {
            wx.navigateTo({
                url: '/pages/goods/goodsDetail/goodsDetail?goodsId=' + e.currentTarget.dataset.id
            })
        },

        goMore: function() {
            if (this.data.shopGoodsClassifyIndex == 'all') {
                wx.navigateTo({
                    url: '/pages/shopGoods/shopGoods?classId=all'
                })
            } else {
                wx.navigateTo({
                    url: '/pages/shopGoods/shopGoods?classId=' + this.data.shopGoodsClassify[this.data.shopGoodsClassifyIndex].class_id
                })
            }
        }
    }
})